package cn.ywsj.ywsjmidtier.service;

import cn.ywsj.ywsjmidtier.common.Connect;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpSession;

@Api(tags = "购物车")
@FeignClient(url = Connect.XSX_URL,name = "xsx")
public interface WechatShoppingCartFeign {

    /**
     * 购物车_提交订单
     * @param jsonObject
     * @return
     */
    @ApiOperation("购物车_提交订单")
    @PostMapping("/wechat/member/shoppingcatmgr/ajaxordersubmit")
    String addOrderSubmit(@RequestParam("jsonObject")JSONObject jsonObject,@RequestParam("session")HttpSession session);

    /**
     * 购物车_下单
     * @param jsonObject
     * @param session
     * @return
     */
    @ApiOperation("购物车_下单")
    @PostMapping("/wechat/member/shoppingcatmgr/ajaxneworderconfirm")
    String ajaxNewOrderconfirm (@RequestParam("jsonObject")JSONObject jsonObject,@RequestParam("session")HttpSession session);

    /**
     * 购物车_加入购物车
     * @param cartList
     * @return
     */
    @ApiOperation("购物车_加入购物车")
    @PostMapping("/wechat/member/shoppingcatmgr/ajaxaddshoppingcart")
    String addShoppingCart (@RequestParam("cartList") String cartList);

    /**
     * 购物车_删除商品
     * @param session
     * @param tradeIds
     * @return
     */
    @ApiOperation("购物车_删除商品")
    @PostMapping("/wechat/member/shoppingcatmgr/delete")
    String delete (@RequestParam("session") HttpSession session,@RequestParam("tradeIds") String tradeIds);

    /**
     * 购物车_选择促销
     * @param
     * @param
     * @return
     */
    @ApiOperation("购物车_选择促销")
    @PostMapping("/wechat/member/shoppingcatmgr/updatemarketactivity")
    String updateMarketActivity (@RequestParam("jsonObject")JSONObject jsonObject,@RequestParam("result") BindingResult result);

    /**
     * 购物车_购物车商品更新数量
     * @param jsonObject
     * @param beforeDesc
     * @return
     */
    @ApiOperation("购物车_购物车商品更新数量")
    @PostMapping("/wechat/member/shoppingcatmgr/updatecartnum")
    String updatecartnum (@RequestParam("jsonObject") JSONObject jsonObject,@RequestParam("beforeDesc")String beforeDesc);

    /**
     * 购物车_购物车列表
     * @param jsonObject
     * @return
     */
    @ApiOperation("购物车_购物车列表")
    @PostMapping("/wechat/member/shoppingcatmgr/ajaxmains")
    String ajaxmains (@RequestParam("jsonObject") JSONObject jsonObject);

    /**
     * 点击再次购买
     * @param cartList
     * @return
     */
    @ApiOperation("点击再次购买")
    @PostMapping("/wechat/member/shoppingcatmgr/ajaxaddtocart")
    String ajaxaddtocart(@RequestParam("cartList") String cartList);

    @PostMapping("/wechat/member/shoppingcatmgr/queryordercount")
    String queryOrderCount(@RequestParam("jsonObject")JSONObject jsonObject);
    @PostMapping("/wechat/member/shoppingcatmgr/addresschange")
    String addressList(@RequestParam("addressId") String addressId,@RequestParam("session") HttpSession session);
}